// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license


#pragma once

#include <alg3d/alg3d.h>


class Transformable
{
public:
    // Ctor
    Transformable();
    virtual ~Transformable() {}

    // --------------------------------------------------------------
    // Directly sets the local transform
    virtual void setLocalTransform(const gx::Mat4 & m);

    gx::Mat4 getLocalTransform() const { return m_localTransform; }

    virtual gx::Mat4 getGlobalTransform() const { return m_localTransform; }

    // Modify the local transform according to the specified transformation
    // They are equivalent to m_localTransform = M * m_localTransform,
    // where M is the transformation specified by the passed argument
    void scaleLocal(double s);
    void scaleLocal(const gx::Vec3& s);
    void rotateLocal(const gx::AxisAngle& aa);
    void moveLocal(const gx::Vec3& delta);

protected:
    // The local transform of this node
    gx::Mat4 m_localTransform; 
};
